<template>
  <div class="home">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item in lunbolist" :key="item.id">
        <img :src="item.img" alt="" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>
<script>
import axios from 'axios'
export default {
  data: () => ({
    lunbolist: []
  }),
  created() {
    this.getLunbo()
  },
  methods: {
    async getLunbo() {
      const { data: { message } } = await axios.get('http://itfly.vip:8888/api/getlunbo')
      this.lunbolist = message
    }
  }
}
</script>
<style lang="scss" scoped>
.home {
  .my-swipe {
    height: 200px;
    background-color: red;
    img {
      width: 100%;
      height: 100%;
    }
  }
}
</style>
